/*
 *  LLJniHelper.h
 *  LID Library
 *
 *  Created by Alexander Trutchenko on 09/11/11.
 *  Copyright 2011 League of Independent Developers. All rights reserved.
 *
 */
 
#ifndef __LL_JniHelper_h__
#define __LL_JniHelper_h__

#include <jni.h>
#include <string>


namespace lidlib {

	typedef struct LLJniMethodInfo_
	{
		JNIEnv *    env;
		jclass      classID;
		jmethodID   methodID;
	} LLJniMethodInfo;

	class LLJniHelper
	{
	public:
		static JavaVM* getJavaVM();
		static void setJavaVM(JavaVM *javaVM);
		static jclass getClassID(const char *className, JNIEnv *env=0);
		static bool getStaticMethodInfo(LLJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
		static bool getMethodInfo(LLJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
		static std::string jstring2string(jstring str);

	private:
		static JavaVM *m_psJavaVM;
	};
	
} // namespace lidlib

#endif // __LL_JniHelper_h__
